package com.yyx.util;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class TestInvocationHandlerOne implements InvocationHandler {
    Object target;
    public TestInvocationHandlerOne(Object target){
        this.target=target;
    }

    /**
     *
     * @param proxy 代理对象
     * @param method  目标对象
     * @param args 目标方法的参数
     * @return
     * @throws Throwable
     */
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Exception {

        System.out.println("做AOP日志");
        return method.invoke(target,args);
    }
}
